import request from '@/utils/request'


// 查询客户列表
export function listCustomer(query) {
  return request({
    url: '/ipms/crm/list',
    method: 'get',
    params: query
  })
}
//查询公海客户列表
export function AllListCustomer(query) {
  return request({
    url: '/ipms/crm/seas/list',
    method: 'get',
    params: query
  })
}
// 查询客户回收站列表
export function getRecycleCustomer(query) {
  return request({
    url: '/ipms/crm/recycle/list',
    method: 'get',
    params: query
  })
}

// 回收站客户移回公海
export function updateRecycleCustomer(customerIds) {
  return request({
    url: '/ipms/crm/recycleLeave/'+customerIds,
    method: 'get',
  })
}

// 查询客户详细
export function getCustomer(customerId) {
  return request({
    url: '/ipms/crm/detailes/' + customerId,
    method: 'get'
  })
}

// 新增客户
export function addCustomer(data) {
  return request({
    url: '/ipms/crm',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/ipms/crm',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomer(customerId) {
  return request({
    url: '/ipms/crm/' + customerId,
    method: 'delete'
  })
}

//新增回访记录
export function addTracking(data) {
  return request({
    url: '/ipms/crm/tracking',
    method: 'post',
    data: data
  })
}


//查询客户详细信息发明人
export function getInventor(customerId) {
  return request({
    url: '/ipms/crm/Inventor/'+customerId ,
    method: 'get',
  })
}

//查询客户详细信息发明人
export function getApplicant(customerId) {
  return request({
    url: '/ipms/crm/applicant/'+customerId ,
    method: 'get',
  })
}
//查询客户详细合同
export function getContract(customerId) {
  return request({
    url: '/ipms/crm/con/'+customerId ,
    method: 'get',
  })
}
//查询客户详细案件
export function getCase(customerId) {
  return request({
    url: '/ipms/crm/case/'+customerId ,
    method: 'get',
  })
}

//查询客户回访信息
export function getTrackingMsg(customerId) {
  return request({
    url: '/ipms/crm/tracking/customer/'+customerId ,
    method: 'get',
  })
}

